class Base
{
    public int a;
    public int b;
    public int c=199;

    public void methodBase(){
        System.out.println("Base");
    }


}
class Derived extends Base
{
    public int c=9;
    public void func()
    {
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);//子类有，优先子类，之类没有则优先父类
        System.out.println(super.c);//访问父类
    }
    public void methodBase(){
        System.out.println("Derived");
    }
    public void fun()
    {
        methodBase();//优先子类
        super.methodBase();//访问父类方法
    }
}

//class Derived extends Base
//{
//    public char b=102;
//    public int c=103;
//    public void func()
//    {
//        System.out.println(a);
//        System.out.println(b);
//        System.out.println(c);//子类有，优先子类，之类没有则优先父类
//        System.out.println(super.c);
//    }
//}
public class Test {
    public static void main(String[] args) {
        Derived der=new Derived();
        der.func();
        der.fun();
    }
}
